#pragma once

#include "Utils\UtilsGL.h"
#include "Utils\mathlib.h"
#include "RenderComponent.h"

#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <cmath>
#include <vector>

#define POINTS_PER_VERTEX 3
#define TOTAL_FLOATS_IN_TRIANGLE 9
using namespace std;

class Model : public RenderComponent
{
public:

	//Constructor
	Model();

	//Destructor
	virtual ~Model();

	//Methods
    float* CalculateNormal(float* coord1,float* coord2,float* coord3 );
    int Load(char *filename);	// Loads the model
	void Draw();					// Draws the model on the screen
	void Release();				// Release the model

private:
	//Methods
	void CreateIndices();
	void Unitize();

	//Members
	float* m_normals;							// Stores the normals
    float* m_Faces_Triangles;					// Stores the triangles
	float* m_vertexBuffer;					// Stores the points which make the object
	vector<float*> DEBUGVERTEXVEC;
	long m_TotalConnectedPoints;				// Stores the total number of connected verteces
	long m_TotalConnectedTriangles;			// Stores the total number of connected triangles

	//Buffer stuff
	enum
	{
		VERTEX = 0,
		INDEX = 1
	};

	GLuint m_BufferID[2];
};
